﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FCS
{
    #region Delegates

    public delegate T FunUnary<T>(T t);
    public delegate U FunUnary<T, U>(T t);
    public delegate T FunUnaryIdx<T>(T t, int idx);
    public delegate U FunUnaryIdx<T, U>(T t, int idx);
    public delegate IFunList<T> FunUnaryL<T>(T t);
    public delegate IFunList<U> FunUnaryL<T, U>(T t);
    public delegate void FunAction<T>(T t);
    public delegate T FunBinary<T>(T t1, T t2);

    public delegate bool FunPredicate0<T>();
    public delegate bool FunPredicate<T>(T t);
    public delegate bool FunPredicate2<T>(T t1, T t2);
    public delegate bool FunPredicateIdx<T>(T t, int idx);
    public delegate bool FunPredicate2Idx<T>(T t1, int idx, T t2);
    public delegate IFunList<T> FunListDelegate<T>();
    public delegate IFunList<T> FunListDelegateList<T>(T head, IFunList<T> tail);
    public delegate T FunValueDelegate<T>();

    #endregion

    #region IFunList<T>

    public interface IFunList<T> : IEnumerable<T>
    {
    }

    #endregion

    #region IFunValue<T>

    public interface IFunValue<T>
    {
        T Value { get; }
    }
    #endregion

    #region FunList<T>

    abstract class FunList<T> : IFunList<T>
    {


        public abstract IEnumerator<T> GetEnumerator();

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }

        #endregion
    }

    #endregion
}
